home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / utilities / boot / osp12.lha / OpenScreenPatch / OpenScreenPatch.s < prev    next >
Encoding:
Text File  |  1995-03-13  |  2.8 KB  |  201 lines

  1. ;    Name
  2. ;        OpenScreenPatch.s
  3. ;
  4. ;    Project
  5. ;        OpenScreenPatch
  6. ;
  7. ;    Version
  8. ;        Version 1.2
  9. ;
  10. ;    Synopsis
  11. ;        Just a quick hack to make output a little nicer
  12. ;
  13. ;    Notes
  14. ;        -
  15.  
  16.  
  17.  
  18. start:
  19.     movem.l d0-d7/a0-a6,-(a7)
  20.     
  21.     move.l    4,a6
  22.     move.l    a6,sysbase
  23.  
  24.     move.l    #gfxname,a1        ;    Open Gfx-Library
  25.     move.l    #37,d0
  26.     jsr    -552(a6)
  27.     move.l    d0,gfxbase
  28.     beq    gfxerror
  29.  
  30.     move.l    #intuitionname,a1    ;    Open Intuition-Library
  31.     move.l    #37,d0
  32.     jsr    -552(a6)
  33.     move.l    d0,intuitionbase
  34.     beq    intuierror
  35.  
  36.     bsr    installpatch
  37.     tst    d0
  38.     beq    close
  39.  
  40. wait:
  41.     move.l    sysbase,a6
  42.     move.l    #%1000000000000,d0    ;    Wait() for CTRL-C
  43.     jsr    -318(a6)
  44.  
  45.     move.l    intuitionbase,a6    ;    Test if somebody else
  46.     cmp.l    #myopenscreen,-198+2(a6);    has patched intuition's
  47.     beq    nootherospatch        ;    OpenScreen ()
  48.     move.l    #0,a0
  49.     jsr    -96(a6)
  50.     bra.w    wait
  51. nootherospatch:
  52.  
  53.     move.l    intuitionbase,a6    ;    Test if somebody else
  54.     cmp.l    #myopenscreentags,-612+2(a6)
  55.     beq    nootherostpatch        ;    has patched OpenScrenTags()
  56.     move.l    #0,a0
  57.     jsr    -96(a6)
  58.     bra.w    wait
  59. nootherostpatch:
  60.     
  61.     bsr    removepatch
  62.  
  63. close:
  64.     move.l    intuitionbase,a1
  65.     jsr    -414(a6)
  66. intuierror:
  67.     move.l    gfxbase,a1
  68.     jsr    -414(a6)
  69. gfxerror:
  70.     movem.l    (a7)+,d0-d7/a0-a6
  71.     moveq    #0,d0
  72.     rts
  73.  
  74.  
  75.  
  76. ; Call OpenScreenTags and set Genlock bit afterwards
  77.  
  78. myopenscreentags:
  79.     move.l    a2,-(a7)        ; save a2
  80.  
  81.     move.l    oldopenscreentags,a2
  82.     jsr    (a2)
  83.     move.l    d0,a2
  84.     tst.l    d0
  85.     beq    myopenscreentagsreturn
  86.  
  87.     movem.l    d0-d7/a0-a6,-(a7)
  88.  
  89.     move.l    48(a2),a0
  90.     move.l    gfxbase,a6
  91.     move.l    #vctags,a1
  92.     jsr    -708(a6)        ; Call VideoControl(a0,a1)
  93.  
  94.     move.l    intuitionbase,a6
  95.     jsr    -384(a6)        ; Call RemakeDisplay ()
  96.  
  97.     movem.l    (a7)+,d0-d7/a0-a6
  98. myopenscreentagsreturn:
  99.     move.l    (a7)+,a2
  100.     rts
  101.  
  102.  
  103.  
  104. ; Call OpenScreen and set Genlock bit afterwards
  105.  
  106. myopenscreen:
  107.     move.l    a1,-(a7)
  108.     move.l    oldopenscreen,a1
  109.     jsr    (a1)
  110.     move.l    d0,a1
  111.     tst.l    d0
  112.     beq    myopenscreenreturn
  113.  
  114.     movem.l    d0-d7/a0-a6,-(a7)
  115.  
  116.     move.l    48(a1),a0
  117.     move.l    gfxbase,a6
  118.     move.l    #vctags,a1
  119.     jsr    -708(a6)        ; Call VideoControl(a0,a1)
  120.  
  121.     move.l    intuitionbase,a6
  122.     jsr    -384(a6)        ; Call RemakeDisplay ()
  123.  
  124.     movem.l    (a7)+,d0-d7/a0-a6
  125. myopenscreenreturn:
  126.     move.l    (a7)+,a1
  127.     rts
  128.  
  129.  
  130.  
  131.  
  132. ;    Install Patch via SetFunction ()
  133.  
  134. installpatch:
  135.     move.l    sysbase,a6
  136.     move.l    intuitionbase,a1
  137.     move.l    #-198,a0
  138.     move.l    #myopenscreen,d0
  139.     jsr    -420(a6)
  140.     move.l    d0,oldopenscreen
  141.  
  142.     move.l    intuitionbase,a1
  143.     move.l    #-612,a0
  144.     move.l    #myopenscreentags,d0
  145.     jsr    -420(a6)
  146.     move.l    d0,oldopenscreentags
  147.     rts
  148.  
  149.  
  150. ;    Remove Patch via SetFunction ()
  151.  
  152. removepatch:
  153.     move.l    sysbase,a6
  154.     move.l    #-198,a0
  155.     move.l    oldopenscreen,d0
  156.     move.l    intuitionbase,a1
  157.     jsr    -420(a6)
  158.  
  159.     move.l    #-612,a0
  160.     move.l    oldopenscreentags,d0
  161.     move.l    intuitionbase,a1
  162.     jsr    -420(a6)
  163.     rts
  164.     
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.     
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. oldopenscreen:        dc.l    0
  180. oldopenscreentags:    dc.l    0
  181.  
  182.             dc.b    0,"$VER: OpenScreenPatch 1.2 (13.02.95)",0
  183. gfxname:        dc.b    "graphics.library",0
  184. intuitionname:        dc.b    "intuition.library",0
  185.  
  186.     even
  187.  
  188. sysbase:        dc.l    4
  189. intuitionbase:        dc.l    4
  190. gfxbase:        dc.l    4
  191.  
  192. vctags:            dc.l    $80000005,1    ; Tags : (BORDERBLANK,TRUE)
  193.             dc.l    0,0
  194.  
  195.     END
  196.  
  197.  
  198.  
  199.  
  200.  
  201.